<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>动态滑动登录框</title>
  <link rel="stylesheet" href="style.css">
  <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>
  <link href="https://cdn.bootcss.com/font-awesome/5.8.1/css/all.min.css" rel="stylesheet">
</head>
<body>
  <div class="show-login-btn">
    <i class="fas fa-sign-in-alt"></i>显示登陆页面
  </div>
  <div class="login-box">
    <div class="hide-login-btn"><i class="fas fa-times"></i></div>
    <form class="login-form" action="index.html" method="POST">
      <h1>欢迎</h1>
      <input class="txtb" type="text" name="" palceholder="Username">
      <input class="txtb" type="password" name="" palceholder="Password">
      <input class="login-btn" type="submit" name="" value="登陆">
    </form>
  </div>
  <script type="text/javascript">
    $(".show-login-btn").on("click",function(){
      $(".login-box").toggleClass("showed");
    });
    $(".hide-login-btn").on("click",function(){
      $(".login-box").toggleClass("showed");
    });
  </script>
</body>
</html>